import request from '@/utils/request'

/**
 * 获取客户列表
 */
export function getClientsApi(params) {
  return request({
    url: '/clients',
    method: 'get',
    params
  })
}
/**
 * 获取客户数量
 */
export function getClientsCounApi(params) {
  return request({
    url: '/clients/count',
    method: 'get',
    params
  })
}
/**
 * 根据id获取客户
 */
export function getClientApi(id) {
  return request({
    url: `/clients/${id}`,
    method: 'get'
  })
}

/**
 * 删除
 */
export function delClientsApi(id) {
  return request({
    url: `/clients/${id}`,
    method: 'delete'
  })
}
/**
 * 编辑
 */
export function editClientsApi(data) {
  return request({
    url: `/clients/${data.id}`,
    method: 'put',
    data
  })
}
/**
 * 新增
 */
export function addClientsApi(data) {
  return request({
    url: '/clients',
    method: 'post',
    data
  })
}

